import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/index',
    name: 'Index',
    component: () => import('../views/Index.vue'),
    children: [
      {
        path: '/',
        name: 'Main',
        component: () => import('../containers/Main.vue'),
      },
      {
        path: '/projectControl',
        name: 'ProjectControl',
        component: () => import('../containers/ProjectControl.vue'),
      },
      {
        path: '/jobControl',
        name: 'JobControl',
        component: () => import('../containers/JobControl.vue'),
      },
      {
        path: '/applyControl',
        name: 'ApplyControl',
        component: () => import('../containers/ApplyControl.vue'),
      },
      {
        path: '/fundControl',
        name: 'FundControl',
        component: () => import('../containers/FundControl.vue'),
      },
      {
        path: '/roleControl',
        name: 'RoleControl',
        component: () => import('../containers/RoleControl.vue'),
      },
      {
        path: '/userControl',
        name: 'UserControl',
        component: () => import('../containers/UserControl.vue'),
      },
      {
        path: '/adminInfo',
        name: 'AdminInfo',
        component: () => import('../containers/AdminInfo.vue'),
      },

    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
